<?php

namespace App\Http\Controllers\Erp;

use App\Repositories\Sale\SaleItemRepository;
use Illuminate\Http\Request;

class SaleItemController extends ErpController
{
    protected $salItemRepository;


    public function __construct(SaleItemRepository $salItemRepository)
    {
        $this->salItemRepository = $salItemRepository;

    }


    //查看销售订单条目列表
    public function list(Request $request)
    {
        $input = $request->input();

        if (empty($input['is_all'])) {
            $list = $this->salItemRepository->getList();
            return $this->paginate($list);
        } else {
            $list = $this->salItemRepository->getAll();
            return $this->success($list);
        }

    }

}